import 'package:mysql1/mysql1.dart' as mysql;

class DBHelper {
  static DBHelper db = DBHelper();

  final _settings = mysql.ConnectionSettings(
      host: '101.200.210.67',
      port: 3306,
      user: 'root',
      password: 'lcmysql1204',
      db: 'test');

  Future connect() async {
    var conn = await mysql.MySqlConnection.connect(_settings);
    return conn;
  }

  Future selectAll() async {
    var conn = await mysql.MySqlConnection.connect(_settings);
    var result = await conn.query("select * from table_1");
    await conn.close();
    for (var row in result) {
      print(row.toList().toString());
      // print("${row[0]}  ${row[1]}");
    }
  }
}
